package dr.request.user.action;

import dr.controller.*;
import dr.request.dao.*;
import dr.request.domain.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class RequestContentAction extends ActionSupportLogin{
	
	public String execute(HttpServletRequest request, 
			HttpServletResponse response) throws Throwable{

		String id=getUserLoginId(request);// session
		
		//login check
		if(id==null) return LOGINULL_PATH;
		//login check
		
		int num = Integer.parseInt(request.getParameter("num"));
		String pageNum = request.getParameter("pageNum");
		
		RequestDAO reDAO = RequestDAO.getInstance();
		Request req = reDAO.getContent(num);
		
		request.setAttribute("pageNum", new Integer(pageNum));
		request.setAttribute("req", req);
		
		return "/request/content.jsp";
		
	}
	
	

}
